package com.xiaocheng.core.strategy.conf;

import java.util.HashMap;

import com.xiaocheng.core.strategy.interfaces.PayInterface;

/**
 * 
* @ClassName: PayMap 
* @Description: 方法工厂类
* @author 高亚鹏
* @date 2018年5月11日 下午11:34:08 
*
 */
public class PayMap {
	public static HashMap<String, Class> paymap = new HashMap<>();
	static{
		for(PayMethod pMethod : PayMethod.values()){
			paymap.put(pMethod.getName(), pMethod.getClazz());
		}
	}
	public static PayInterface getPaytype(String key) throws InstantiationException, IllegalAccessException{
		PayInterface payInterface = (PayInterface) paymap.get(key).newInstance();
		return payInterface;
	}
}
